new Vue({
    el: ".container",
    data: {
        title: '',
        goodsPage: {}
    },
    methods: {
        searchTitle: function (pageNum) {
            axios({
                url: `/goods/searchTitle/${pageNum}`,
                params: {"title": this.title}
            }).then(res => {
                if (res.data.flag) {
                    this.goodsPage = res.data.data;
                }
            })
        },
        toDetail: function (goodsId) {
            sessionStorage.setItem("goodsId", goodsId);
            location.href = "goodsDetail.html"
        }
    },
    created: function () {
        this.title = sessionStorage.getItem("searchTitle");
        this.searchTitle(1);
    }
})